package com.elcl.util;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

/**
 * Created by lichunlin on 17/6/15.
 */

public class ApkUtils {

    //安装apk的方法
    public static void installApk(Context context) {
        Uri uri = Uri.fromFile(FileUtils.updateFile);
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setDataAndType(uri, "application/vnd.android.package-archive");
        context.startActivity(intent);
    }


}
